*******************************************************************************
* Specify city and years
*******************************************************************************

local city = "east_baton_rouge"

use dataset_`city'_cross, clear

local y1 2000
local y2 2010
local y3 2020

*******************************************************************************
* Ref support and percent black
*******************************************************************************

foreach year in `y1' `y2' `y3' {
	
	#delimit;
	
	gr tw
		(sc turnout pctnhblack if year == `year' [aw=registeredvoters], 
			msym(Oh) msize(tiny) col(gray))
		(lpoly turnout pctnhblack if year == `year' [aw=registeredvoters], 
			lcol(black) lwid(thick))
		,
			legend(off)
			plotregion(style(none))
			ylab(, angle(horiz))
			name(g`year', replace)
			title(`year')
			xtitle("")
			ytitle("")
			scale(2)
			;
			
	#delimit cr
	
	gr close
	
}

gr combine g`y1' g`y2' g`y3', rows(1) xsize(3) ysize(1) ycommon xcommon ///
	b1title("Share Black", size(vlarge)) ///
	l1title("Turnout", size(vlarge)) ///
	imargin(zero)
	
gr export "_output/figure A11 a.pdf", replace

*******************************************************************************
* Ref support and miles from shooting
*******************************************************************************
foreach year in `y1' `y2' `y3' {
	
	#delimit;
	
	gr tw
		(sc turnout distance if year == `year' [aw=registeredvoters], 
			msym(Oh) msize(tiny) col(gray))
		(lpoly turnout distance if year == `year' [aw=registeredvoters], 
			lcol(black) lwid(thick))
		,
			legend(off)
			plotregion(style(none))
			ylab(, angle(horiz))
			name(g`year', replace)
			title(`year')
			xtitle("")
			ytitle("")
			scale(2)
			xscale(reverse)
			;
			
	#delimit cr
	
	gr close
	
}

gr combine g`y1' g`y2' g`y3', rows(1) xsize(3) ysize(1) ycommon xcommon ///
	b1title("Distance to Shooting (Miles)", size(vlarge)) ///
	l1title("Turnout", size(vlarge)) ///
	imargin(zero)
	
gr export "_output/figure A11 b.pdf", replace

*******************************************************************************
* End
*******************************************************************************
